<template>
	<el-form-item :prop="prop" :label="label">
		<el-switch v-bind="$attrs" inline-prompt :disabled="!isEdit" :active-text="activeText"
			:inactive-text="inactiveText" />
	</el-form-item>
</template>

<script lang="ts" setup>
// 是否启用输入框
// 用法 <MkIsEnabled label='是否启用' v-model='ctx.entity.isEnabled' prop='isEnabled' :isEdit='ctx.isEdit' />
defineOptions({
	name: 'MkIsEnabled'
})

const props = defineProps({
	prop: {
		type: String,
		default: 'isEnabled',
	},
	label: {
		type: String,
		default: '是否启用',
	},
	isEdit: {
		type: Boolean,
		default: true
	},
	activeText: {
		type: String,
		default: '启用'
	},
	inactiveText: {
		type: String,
		default: '不启用'
	}
})

</script>